package com.winenine999.generator.dao;

import com.winenine999.model.Winebrand;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface WinebrandMapper {
    @Delete({
        "delete from winebrand",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into winebrand (id, brandname, ",
        "branddetail)",
        "values (#{id,jdbcType=INTEGER}, #{brandname,jdbcType=VARCHAR}, ",
        "#{branddetail,jdbcType=VARCHAR})"
    })
    int insert(Winebrand record);

    int insertSelective(Winebrand record);

    @Select({
        "select",
        "id, brandname, branddetail",
        "from winebrand",
        "where id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("com.winenine999.generator.dao.WinebrandMapper.BaseResultMap")
    Winebrand selectByPrimaryKey(Integer id);

    int updateByPrimaryKeySelective(Winebrand record);

    @Update({
        "update winebrand",
        "set brandname = #{brandname,jdbcType=VARCHAR},",
          "branddetail = #{branddetail,jdbcType=VARCHAR}",
        "where id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(Winebrand record);
}